<!-- 备品备件 -->
<script type="text/html" template>
    <link rel="stylesheet" href="{{ layui.setter.base }}style/index.css">
    <link rel="stylesheet" href="{{ layui.setter.base }}style/autoComplete.css">
    <link rel="stylesheet" href="{{ layui.setter.base }}style/css/reset.css">
    <link rel="stylesheet" href="{{ layui.setter.base }}style/alert.css">
    <link rel="stylesheet" href="{{ layui.setter.base }}style/alert-form.css">
</script>
    <div class="layui-form layui-fluid row" lay-filter="alert_formOne" id="alert_formOne">
            <div class="layui-form-item">
                <label class="layui-form-label">
                    <span style="font-size: 18px;color: red;position: relative;display: inline-block;line-height: 20px;vertical-align: middle;top:3px;">*</span>
                    设备型号：
                </label>
                <div class="layui-input-block">
                    <input type="text" name="fii02" required lay-verify="required" placeholder="" autocomplete="off" class="layui-input" id="title1">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">设备系列：</label>
                <div class="layui-input-block">
                    <input type="text" name="fii01"  autocomplete="off" class="layui-input ipt_disabled" disabled>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">供应商：</label>
                <div class="layui-input-block">
                    <input type="text" name="tcSeriesPmc01" autocomplete="off" class="layui-input ipt_disabled" disabled>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">设备型号说明：</label>
                <div class="layui-input-block">
                    <input type="text" name="fii03"  autocomplete="off" class="layui-input ipt_disabled" disabled>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">
                    <span style="font-size: 18px;color: red;position: relative;display: inline-block;line-height: 20px;vertical-align: middle;top:3px;">*</span>
                    关联备品备件编号：
                </label>
                <div class="layui-input-block">
                    <input type="text" name="ima01" required lay-verify="required"autocomplete="off" class="layui-input" id="title2">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">关联备品备件名称：</label>
                <div class="layui-input-block">
                    <input type="text" name="ima02"  autocomplete="off" class="layui-input ipt_disabled" disabled>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">关联备品备件规格：</label>
                <div class="layui-input-block">
                    <input type="text" name="ima021" autocomplete="off" class="layui-input ipt_disabled" disabled>
                </div>
            </div>
        <div class="footer layui-form-item layui-fluid" style="margin-top: 30px;">
            <button data-lang="confirm" class="btn1 layui-btn layui-btn-radius layui-btn-primary"
              lay-filter="submit" lay-submit>确定</button>
            <button data-lang="cancel" class="btn2 layui-btn layui-btn-radius layui-btn-primary">取消</button>
        </div>
    </div>
<script>
   layui.use(['table', 'admin', 'laypage', 'jquery', 'laytpl', 'tree', 'form', 'api', 'view', 'laydate', 'setter', 'treeSelect','element','utill'], function () {
        var form = layui.form;
        var table = layui.table;
        var admin = layui.admin;
        var laypage = layui.laypage;
        var $ = layui.jquery;
        var laytpl = layui.laytpl;
        var tree = layui.tree;
        var api = layui.api;
        var view = layui.view;
        var laydate = layui.laydate;
        var setter = layui.setter;
        var treeSelect = layui.treeSelect;
        var utill = layui.utill;
        var element = layui.element;
            utill.fuzzmatch('#title1', {
                isShowValue: false,
                reqObj: {
                    url: api.host + '/fil/querySelectFiiFileList.json',
                    type: 'POST',
                    dataType: 'json',
                    contentType: 'application/json',
                    data:JSON.stringify({
                        fii05:$('#title1').val(),
                        pageNum: 1,
                        pageSize: 10000
                    }),
                },
                dataTrans: function (res) {
                    return res.data.list.map((item) => {
                        return {
                            label: item.fii02,
                            value: item.fii02,
                            data: item
                        }
                    })
                },
                done:function(res){
                    const data = res.data;
                    $("input[name='fii01']").attr('value',data.fii01);
                    $("input[name='fii03']").attr('value',data.fii03);
                    $("input[name='tcSeriesPmc01']").attr('value',data.tcSeriesPmc01);
                }
            });
            utill.fuzzmatch('#title2', {
                isShowValue: false,
                reqObj: {
                    url: api.host + '/ima/ImaSelectIma01.json',
                    type: 'POST',
                    dataType: 'json',
                    contentType: 'application/json',
                    data:JSON.stringify({
                        ima01:$('#title2').val(),
                        pageNum: 1,
                        pageSize: 10000
                    }),
                },
                dataTrans: function (res) {
                    return res.data.list.map((item) => {
                        return {
                            label: item.ima01,
                            value: item.ima01,
                            data: item
                        }
                    })
                },
                done:function(res){
                    let data = res.data;
                    $("input[name='ima02']").attr('value',data.ima02);
                    $("input[name='ima021']").attr('value',data.ima021);
                }
            });
    });
</script>